
$(document).ready(function () {	
	$('#saveplansd').click(function () {
		savePlan();
	});
});

function navigateSucc(){
	window.location.href="save_plan_succ.jsp";
}

function getPaList(){	
	var timestamp = Date.parse(new Date());
	$.get("lzm/Session_findPaList.action?ts="+timestamp,null,getPaListRst);
}

function getPaListRst(data){
	$.each(data.paList,function(i,n){
		var htmlStr="";
		htmlStr+="<div><img src='lzm/images/doc.gif'/><span class='fn'>"
		htmlStr+=n.paName;
		htmlStr+="</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class='dell'>删除</span></div>";
		$('#paListDIV').append(htmlStr);
	});
}

/**
 * 作增加预案
 */
function savePlan(){
	var url = 'lzm/SavePlan_savePlanStandard.action';
	var params = {
			'planStandard.PId':'1000000008',
			'planStandard.elId':$('#elId').attr('value'),
			'planStandard.EDeaths':$('#EDeaths').attr('value'),
			'planStandard.PPoisoning':$('#PPoisoning').attr('value'),
			'planStandard.PImpact':$('#PImpact').attr('value'),
			'planStandard.c':$('#c').attr('value')
	}; 
	jQuery.post(url, params, savePlanRst, 'json');
}

/**
 * 作增加预案回调函数
 */
function savePlanRst(data){
	alert("gggg");
	alert(data.ajaxRst);
}